import React from "react";
import { createRoot } from "react-dom/client";
import { Provider } from "react-redux";
import { store } from "./app/store";
import App from "./App";
import reportWebVitals from "./reportWebVitals";
import "./index.css";
import { Routes, Route, BrowserRouter, Link } from "react-router-dom";
import PostList from "./features/post/PostList";
const container = document.getElementById("root")!;
const root = createRoot(container);


root.render(
  <BrowserRouter>
    <ul>
      <li>
        <Link to="/posts">Post</Link>
      </li>
      <li>
        <Link to="/counter">Counter</Link>
      </li>
    </ul>

    <Provider store={store}>
      <Routes>
        <Route path="/" element={<App></App>}></Route>
        <Route path="/counter" element={<App></App>}></Route>
        <Route path="/posts" element={<PostList></PostList>}></Route>
      </Routes>
    </Provider>
  </BrowserRouter>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
